import { Footer } from "@/components/footer"; import { LinkButton } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; import metadata from "@/public/docs/meta.json"; import { getBaseUrl, getCanonicalUrl } from "@/utils/urls"; import type { Metadata } from "next"; import Link from "next/link"; import { BsDiscord, BsGithub } from "react-icons/bs"; import { HiUserAdd, HiViewGridAdd } from "react-icons/hi"; interface Props { params: Promise<{ pathname: string[]; }>; children: React.ReactNode; } export const generateMetadata = async ({ params }: Props): Promise => { const { pathname } = await params; const meta = metadata.pages.find((page) => page.file === `${pathname.join("/").toLowerCase()}.md`); const title = meta?.file === "index.md" ? "Documentation" : `${meta?.name} docs`; const url = getCanonicalUrl("docs", ...pathname); const images = { url: meta?.image || `${getBaseUrl()}/waya-v3.webp?v=2`, alt: meta?.description, heigth: 1_008, width: 1_935 }; return { title, description: meta?.description, alternates: { canonical: url }, openGraph: { title, description: meta?.description, url, type: "article", images }, twitter: { card: "summary_large_image", title, description: meta?.description, images } }; }; export default async function RootLayout({ params, children }: Props) { const { pathname } = await params; const meta = metadata.pages.find((page) => page.file === `${pathname.join("/").toLowerCase()}.md`); const title = meta?.file === "index.md" ? "Wamellow" : meta?.name; return (

{title} Documentation

{meta?.description}
{children}
); } function NavButton({ page }: { page: typeof metadata.pages[0]; }) { const file = page.file.replace(/\.md$/, ""); const icon = page.name.split(" ").shift() || ""; const name = page.name.replace(icon, ""); return (
  • {icon} {name}
  • ); }